Jupyter Notebooks come installed with Anaconda, and are accessible on Longleaf through OpenOnDemand.
plotmapper.py can be found in the JNBTools repo on Github.
Plotmapper.py includes a variety of tools for plotting:
I'm happy to help with this. Instructions are on the GitHub page.
The first code cell of a notebook should define defaults and load in modules
For high-level plotting functions, you only need to import plotmapper.
For this demonstration, I also need matplotlib.pyplot.
# Display plots in-line
%matplotlib inline
# import modules
import plotmapper as MaP
import matplotlib.pyplot as plt
MaP.Sample is the core object in this package. For each MaP experimental sample, it holds the following information.
example1 = MaP.Sample(sample="example1",
profile = 'data/example1_rnasep_profile.txt',
ct = 'data/RNaseP.ct',
ss = 'data/RC_CRYSTAL_STRUCTURE.xrna',
rings = 'data/example1-rnasep.corrs',
pairs = 'data/example1-rnasep-pairmap.txt',
log = 'data/example1_shapemapper_log.txt',
dance_prefix = 'data/example1_rnasep',
deletions = 'data/example-rnasep-deletions.txt',
fasta = 'data/RNaseP-noSC.fasta',
pdb = 'data/3dhs_Correct.pdb',
pdb_name = '3dhs')
example2 = MaP.Sample(sample="example2",
profile = 'data/example2_rnasep_profile.txt',
ct = 'data/RNaseP.ct',
ss = 'data/RC_CRYSTAL_STRUCTURE.xrna',
rings = 'data/example2-rnasep.corrs',
pairs = 'data/example2-rnasep-pairmap.txt',
log = 'data/example2_shapemapper_log.txt',
dance_prefix = 'data/example2_rnasep',
deletions = 'data/example-rnasep-deletions.txt',
fasta = 'data/RNaseP-noSC.fasta',
pdb = 'data/3dhs_Correct.pdb',
pdb_name = '3dhs')
example3 = MaP.Sample(sample="example3",
profile = 'data/example3_rnasep_profile.txt',
ct = 'data/RNaseP.ct',
ss = 'data/RC_CRYSTAL_STRUCTURE.xrna',
rings = 'data/example3-rnasep.corrs',
pairs = 'data/example3-rnasep-pairmap.txt',
log = 'data/example3_shapemapper_log.txt',
dance_prefix = 'data/example3_rnasep',
deletions = 'data/example-rnasep-deletions.txt',
fasta = 'data/RNaseP-noSC.fasta',
pdb = 'data/3dhs_Correct.pdb',
pdb_name = '3dhs')
example4 = MaP.Sample(sample="example4",
profile = 'data/example4_rnasep_profile.txt',
ct = 'data/RNaseP.ct',
ss = 'data/RC_CRYSTAL_STRUCTURE.xrna',
rings = 'data/example4-rnasep.corrs',
pairs = 'data/example4-rnasep-pairmap.txt',
log = 'data/example4_shapemapper_log.txt',
dance_prefix = 'data/example4_rnasep',
deletions = 'data/example-rnasep-deletions.txt',
fasta = 'data/RNaseP-noSC.fasta',
pdb = 'data/3dhs_Correct.pdb',
pdb_name = '3dhs')
example2.make_log_qc();
MaP.array_qc([example1, example2, example3, example4]);
fig, ax = plt.subplots(1,2, figsize=(14,7))
example2.plot_regression(example1, ax=ax[0])
example4.plot_regression(example3, ax=ax[1], colorby="nucleotide")
example2.plot_sm_profile();
example2.plot_sm_rates();
example2.plot_sm_depth();
example2.make_shapemapper();
example2.make_skyline();
MaP.array_skyline([example1, example2, example3, example4]);
example2.make_dance_skyline();
The plots I'll be showing don't have colorbars yet. To get a stand-alone colorbar, use the view_colormap() function:
MaP.view_colormap("pairs")
MaP.view_colormap("rings")
MaP.view_colormap("deletions")
MaP.view_colormap("deletions", metric="Distance")
fig, ax = plt.subplots(1, 2, figsize=(14, 7))
example2.make_heatmap("deletions", "pdb", ax=ax[0])
example2.make_heatmap("deletions", "ct", ax=ax[1]);
example2.make_ap(attribute="deletions", Percentile=0.95);
MaP.array_ap([example1, example2, example3, example4], attribute="rings", cdAbove=15);
example2.make_ss(attribute="rings");
MaP.array_ss([example1, example2, example3, example4], attribute="pairs");
Controls:
example2.make_3d(attribute="deletions", metric="Distance", Percentile=0.99)
You appear to be running in JupyterLab (or JavaScript failed to load for some other reason). You need to install the 3dmol extension:
jupyter labextension install jupyterlab_3dmol
<py3Dmol.view at 0x18a7ac98940>
MaP.array_3d([example1, example2, example3, example4], attribute="rings", Statistic=15)
You appear to be running in JupyterLab (or JavaScript failed to load for some other reason). You need to install the 3dmol extension:
jupyter labextension install jupyterlab_3dmol
<py3Dmol.view at 0x18a7c27c1d0>
PlotMapper and Jupyter Notebooks provides a fast and easy way to explore MaP and JuMP data sets.